﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using ArlesInterfaces.Editor;
using Arles.src.model;
using Arles.src.model.objects;

namespace Arles.src.controller.Commands
{
    public class HeightmapImportCommand : Command<IEditor>
    {
        string filename;

        public HeightmapImportCommand(IEditor editor, string filename)
            : base(editor, "HeightmapOptions", 1)
        {
            this.filename = filename;
        }

        public override void Execute()
        {
            ObjectFactory.Instance.CreateObject(Editor.Instance.Scene, ObjectType.Terrain);
            HeightmapObject heightmap = (HeightmapObject)Editor.Instance.Scene.GetObject(ObjectType.Terrain);
            heightmap.HeightmapFile = filename;
        }

        public override void Undo()
        {
            Editor.Instance.Scene.DeleteObject(ObjectType.Terrain);
        }

        public override string toString()
        {
            return filename;
        }
    }
}
